package com.iwayin.core.dao.vote;

import java.util.List;

import com.iwayin.core.dataobject.AnswerDO;
import com.iwayin.core.dataobject.AnswerVoteDO;

/**
 * 投票
 * @author xiaobo.feng<xiaobo.feng@foxmail.com>
 *
 * May 9, 2012
 */
public interface AnswerVoteDAO {
	/**
	 * 根据主键查找
	 * @param vote
	 * @return
	 */
	public AnswerVoteDO getByAskIdUserId(AnswerVoteDO vote);
	/**
	 * 根据主键更新
	 * @param vote
	 * @return
	 */
	public Integer updateVoteByAskIdUserId(AnswerVoteDO vote);
	/**
	 * 添加投票
	 * @param vote
	 * @return
	 */
	public void addAnswerVote(AnswerVoteDO vote);
	/**
	 * 根据askId删除投票，级联删除
	 * @param askId
	 * @return
	 */
	public Integer deleteVoteByAskId(Long askId);
	/**
	 *  根据 AskId查询投票信息
	 * @param askId
	 * @return
	 */
	public List<AnswerVoteDO> findAskVotesByAskId(AnswerDO query);
	

}
